package synapsolution;

import java.util.ArrayList;

public class Layer extends ArrayList<Neuron> {

    public Layer(int size) {
        for (int i = 0; i < size; i++) add(new Neuron());
    }

    public Layer(int size, Layer output) {
        for (int i = 0; i < size; i++) add(new Neuron(output));
    }

    public void deactivate() {
        for (Neuron n : this) n.activated = false;
    }

    public void combine(Layer a, Layer b) {
        for (int i = 0; i < size(); i++) get(i).combine(a.get(i), b.get(i));
    }

    @Override
    public String toString() {
        String out = "";
        for (Neuron n : this) out += n + "\n";
        return out;
    }
}
